// 下面是一个说明依赖注入带来的好处的不错的经典案例，没有实现具体功能
// 仅理解原理

// 依赖注入 -- 创建和使用分离
class InkPrinit {
  paper: B5Paper = new B5Paper();
  ink: GrayInk = new GrayInk();
  print() {}
}

// 激光打印机
class LaserPrint {
  paper: B5Paper = new B5Paper();
  print() {}
}

// 针式打印机
class NeedleTypePrinter {
  paper: A4Paper = new A4Paper();
  print() {}
}

// 喷墨打印机
class InkPrint {
  paper: B5Paper = new B5Paper();
  ink: GrayInk = new GrayInk();

  print() {}
}
